import http from '@/utils/request'
// 获取文章分类
export const artGetChannelsService = () => {
  return http.get('/my/article/cates')
}

// 添加文章分类
export const artAddChannelService = (obj) => {
  return http.post('/my/article/addcates', obj)
}

// 编辑/更新文章分类
export const artEditChannelService = (obj) => {
  return http.post('/my/article/updatecate', obj)
}

// 删除文章分类
export const artDelChannelService = (id) => {
  return http.get(`/my/article/deletecate/${id}`)
}

// 获取文章列表
export const artGetListService = () => {
  return http.get('/my/article/list')
}

// 添加文章
export const artAddService = (data) => {
  return http.post('/my/article/add', data)
}

// 根据id获取文章详情
export const artGetArtIdService = (id) => {
  return http.get(`/my/article/detail/${id}`)
}

// 修改文章内容
export const artSetArtService = (data) => {
  return http.post('/my/article/update', data)
}

// 删除文章
export const artDelArtService = (id) => {
  return http.post('/my/article/delete', { id })
}

// 根据文章分类id 和 文章状态 筛选数据
export const artGetListByCateIdService = (cate_id, state) => {
  return http.post('/my/article/list/cate_id/state', { cate_id, state })
}
